package com.forester.foresterplatform.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.List;

import com.forester.foresterplatform.system.entity.BaseEntity;
import org.springframework.data.annotation.Id;

@Data
@EqualsAndHashCode(callSuper = true)
@TableName("system_role")
public class Role extends BaseEntity {

    /**
    * 主键
    */
    @Id
    private Long id;

    /**
    * 代表权限的字符串
    */
    private String key;

    /**
    * 名称
    */
    private String name;

    /**
    * 排序
    */
    private Integer sort;

    /**
     * 一个角色对应多个用户
     */
    @TableField(exist = false)
    private List<User> users;

    /**
     * 一个角色拥有多个权限
     */
    @TableField(exist = false)
    private List<Permission> permissions;
}